:: 支持utf-8编码显示
chcp 65001 > nul
set "MONGO_HOME=D:\Program Files\mongosh-2.5.9-win32-x64"
cd /d "%MONGO_HOME%"
"%MONGO_HOME%\bin\mongosh" --port 4001
:: 只能手动输入
rs.initiate({
  _id: "shard1",
  members: [
    { _id: 0, host: "localhost:4001", priority: 2 },  // 主节点优先级高
    { _id: 1, host: "localhost:4002", priority: 1 }   // 从节点
  ]
})